package cn.ymatou.activityadmin.service;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONArray;
import org.json.JSONObject;

import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.business.service.AdminCallService;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;

public class CloseProductActivityCall extends YmatouAutoTestCall{
	private static String opurl ="/JsonData/CloseProductActivity";
	
	public CloseProductActivityCall() {
		super(EnvSetup.getSystemUrl("activityadmin"),opurl,"POST","JSON");
	}
	
	@Override
	public void addDefHeader() {
		client.addHeader("Cookie", cookie);
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	public JSONObject closeProductInActivity(List<Integer> productInActivityId){
		CloseProductActivityCall closeProductActivityCall = new CloseProductActivityCall();
		closeProductActivityCall.setCookies(AdminCallService.getLoginCookieList());
		return closeProductActivityCall.callAndGetReturnData(MapUtil.hashMap("search->ProductInActivityIds",new JSONArray(productInActivityId)));
	}
	
	public static void main(String[] args) throws ClientProtocolException, IOException {
/*		AdminCallService.getLoginCookieList();
		AuditApproveCall approveCall= new AuditApproveCall();
		approveCall.setCookies(AdminCallService.getLoginCookieList());
		
		*/
		new CloseProductActivityCall().closeProductInActivity(Arrays.asList(291237));
	}
}
